<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template basic_channel_logger</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../index.html" title="Chapter&#160;1.&#160;Boost.Log v2">
<link rel="up" href="../../../logging_sources.html#header.boost.log.sources.channel_feature_hpp" title="Header &lt;boost/log/sources/channel_feature.hpp&gt;">
<link rel="prev" href="../../../BOOST_LOG_DECLARE_WLOGGER_MT.html" title="Macro BOOST_LOG_DECLARE_WLOGGER_MT">
<link rel="next" href="basic_channel_logger/make_default_channel_name.html" title="Struct make_default_channel_name">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../../BOOST_LOG_DECLARE_WLOGGER_MT.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../logging_sources.html#header.boost.log.sources.channel_feature_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="basic_channel_logger/make_default_channel_name.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.log.sources.basic_channel_logger"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_channel_logger</span></h2>
<p>boost::log::sources::basic_channel_logger &#8212; Channel feature implementation. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../logging_sources.html#header.boost.log.sources.channel_feature_hpp" title="Header &lt;boost/log/sources/channel_feature.hpp&gt;">boost/log/sources/channel_feature.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BaseT<span class="special">,</span> <span class="keyword">typename</span> ChannelT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="basic_channel_logger.html" title="Class template basic_channel_logger">basic_channel_logger</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">BaseT</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">char_type</span>                         <a name="boost.log.sources.basic_channel_logger.char_type"></a><span class="identifier">char_type</span><span class="special">;</span>          <span class="comment">// Character type. </span>
  <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">final_type</span>                        <a name="boost.log.sources.basic_channel_logger.final_type"></a><span class="identifier">final_type</span><span class="special">;</span>         <span class="comment">// Final type. </span>
  <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">threading_model</span>                   <a name="boost.log.sources.basic_channel_logger.threading_model"></a><span class="identifier">threading_model</span><span class="special">;</span>    <span class="comment">// Threading model being used. </span>
  <span class="keyword">typedef</span> <span class="identifier">ChannelT</span>                                     <a name="boost.log.sources.basic_channel_logger.channel_type"></a><span class="identifier">channel_type</span><span class="special">;</span>       <span class="comment">// Channel type. </span>
  <span class="keyword">typedef</span> <span class="identifier">attributes</span><span class="special">::</span><span class="identifier">mutable_constant</span><span class="special">&lt;</span> <span class="identifier">channel_type</span> <span class="special">&gt;</span> <a name="boost.log.sources.basic_channel_logger.channel_attribute"></a><span class="identifier">channel_attribute</span><span class="special">;</span>  <span class="comment">// Channel attribute type. </span>
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                                  <a name="boost.log.sources.basic_channel_logger.open_record_lock"></a><span class="identifier">open_record_lock</span><span class="special">;</span>   <span class="comment">// Lock requirement for the <code class="computeroutput">open_record_unlocked</code> method. </span>
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                                  <a name="boost.log.sources.basic_channel_logger.swap_lock"></a><span class="identifier">swap_lock</span><span class="special">;</span>          <span class="comment">// Lock requirement for the <code class="computeroutput">swap_unlocked</code> method. </span>

  <span class="comment">// member classes/structs/unions</span>

  <span class="comment">// Default channel name generator.</span>

  <span class="keyword">struct</span> <a class="link" href="basic_channel_logger/make_default_channel_name.html" title="Struct make_default_channel_name">make_default_channel_name</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <span class="identifier">channel_type</span> <a class="link" href="basic_channel_logger/make_default_channel_name.html#boost.log.sources.basic_channel_logger.make_default_channel_name.result_type"><span class="identifier">result_type</span></a><span class="special">;</span>

    <span class="comment">// <a class="link" href="basic_channel_logger/make_default_channel_name.html#idp33485136-bb">public member functions</a></span>
    <span class="identifier">result_type</span> <a class="link" href="basic_channel_logger/make_default_channel_name.html#idp33485696-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_channel_logger.html#boost.log.sources.basic_channel_loggerconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="basic_channel_logger.html#idp33501904-bb"><span class="identifier">basic_channel_logger</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_channel_logger.html#idp33502672-bb"><span class="identifier">basic_channel_logger</span></a><span class="special">(</span><a class="link" href="basic_channel_logger.html" title="Class template basic_channel_logger">basic_channel_logger</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_channel_logger.html#idp33504352-bb"><span class="identifier">basic_channel_logger</span></a><span class="special">(</span><a class="link" href="basic_channel_logger.html" title="Class template basic_channel_logger">basic_channel_logger</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> <span class="keyword">explicit</span> <a class="link" href="basic_channel_logger.html#idp33506032-bb"><span class="identifier">basic_channel_logger</span></a><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_channel_logger.html#idp33496192-bb">public member functions</a></span>
  <span class="identifier">channel_type</span> <a class="link" href="basic_channel_logger.html#idp33496752-bb"><span class="identifier">channel</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_channel_logger.html#idp33499040-bb"><span class="identifier">channel</span></a><span class="special">(</span><span class="identifier">channel_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_channel_logger.html#idp32965040-bb">protected member functions</a></span>
  <span class="identifier">channel_attribute</span> <span class="keyword">const</span> <span class="special">&amp;</span> <a class="link" href="basic_channel_logger.html#idp32965616-bb"><span class="identifier">get_channel_attribute</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> <span class="identifier">record</span> <a class="link" href="basic_channel_logger.html#idp32967184-bb"><span class="identifier">open_record_unlocked</span></a><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_channel_logger.html#idp32970432-bb"><span class="identifier">swap_unlocked</span></a><span class="special">(</span><a class="link" href="basic_channel_logger.html" title="Class template basic_channel_logger">basic_channel_logger</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_channel_logger.html#idp32972832-bb">private member functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
    <span class="identifier">record</span> <a class="link" href="basic_channel_logger.html#idp32973408-bb"><span class="identifier">open_record_with_channel_unlocked</span></a><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> 
    <span class="identifier">record</span> <a class="link" href="basic_channel_logger.html#idp32977856-bb"><span class="identifier">open_record_with_channel_unlocked</span></a><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">parameter</span><span class="special">::</span><span class="identifier">void_</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp133898384"></a><h2>Description</h2>
<div class="refsect2">
<a name="idp133898800"></a><h3>
<a name="boost.log.sources.basic_channel_loggerconstruct-copy-destruct"></a><code class="computeroutput">basic_channel_logger</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp33501904-bb"></a><span class="identifier">basic_channel_logger</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Default constructor. The constructed logger has the default-constructed channel name. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp33502672-bb"></a><span class="identifier">basic_channel_logger</span><span class="special">(</span><a class="link" href="basic_channel_logger.html" title="Class template basic_channel_logger">basic_channel_logger</a> <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp33504352-bb"></a><span class="identifier">basic_channel_logger</span><span class="special">(</span><a class="link" href="basic_channel_logger.html" title="Class template basic_channel_logger">basic_channel_logger</a> <span class="special">&amp;&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Move constructor </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> <span class="keyword">explicit</span> <a name="idp33506032-bb"></a><span class="identifier">basic_channel_logger</span><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre>
<p>Constructor with arguments. Allows to register a channel name attribute on construction.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">args</code></span></p></td>
<td>
<p>A set of named arguments. The following arguments are supported: </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="computeroutput">channel</code> - a string that represents the channel name </p></li></ul></div>
<p>
</p>
</td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp133930880"></a><h3>
<a name="idp33496192-bb"></a><code class="computeroutput">basic_channel_logger</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">channel_type</span> <a name="idp33496752-bb"></a><span class="identifier">channel</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>The observer of the channel name</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The channel name that was set by the logger </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp33499040-bb"></a><span class="identifier">channel</span><span class="special">(</span><span class="identifier">channel_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> ch<span class="special">)</span><span class="special">;</span></pre>
<p>The setter of the channel name</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">ch</code></span></p></td>
<td><p>The channel name to be set for the logger </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp133949968"></a><h3>
<a name="idp32965040-bb"></a><code class="computeroutput">basic_channel_logger</code> protected member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">channel_attribute</span> <span class="keyword">const</span> <span class="special">&amp;</span> <a name="idp32965616-bb"></a><span class="identifier">get_channel_attribute</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Channel attribute accessor </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> <span class="identifier">record</span> <a name="idp32967184-bb"></a><span class="identifier">open_record_unlocked</span><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre>
<p>Unlocked <code class="computeroutput">open_record</code> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp32970432-bb"></a><span class="identifier">swap_unlocked</span><span class="special">(</span><a class="link" href="basic_channel_logger.html" title="Class template basic_channel_logger">basic_channel_logger</a> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Unlocked swap </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp133974880"></a><h3>
<a name="idp32972832-bb"></a><code class="computeroutput">basic_channel_logger</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
  <span class="identifier">record</span> <a name="idp32973408-bb"></a><span class="identifier">open_record_with_channel_unlocked</span><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span> args<span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> ch<span class="special">)</span><span class="special">;</span></pre>The <code class="computeroutput">open_record</code> implementation for the case when the channel is specified in log statement. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> 
  <span class="identifier">record</span> <a name="idp32977856-bb"></a><span class="identifier">open_record_with_channel_unlocked</span><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span> args<span class="special">,</span> 
                                           <span class="identifier">parameter</span><span class="special">::</span><span class="identifier">void_</span><span class="special">)</span><span class="special">;</span></pre>The <code class="computeroutput">open_record</code> implementation for the case when the channel is not specified in log statement. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2007-2014 Andrey Semashev<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../../BOOST_LOG_DECLARE_WLOGGER_MT.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../logging_sources.html#header.boost.log.sources.channel_feature_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="basic_channel_logger/make_default_channel_name.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
